<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/footer.css">
    <link rel="stylesheet" href="../css/jingdian.css">
    <script src="../js/jquery-1.js"></script>
    <script src="../js/cookie.js"></script>
</head>
<body style="width:100%;height:100%">
  
    <div style="width:1200px;margin:10% auto;height:600px;">
        <div>所属院校：<b>天津机电职业技术学院</b></div>
        <div>姓名：<b>刘亚峰</b></div>
        <div>所属专业：<b>CXXXXX</b></div>
        <div>专业教师：<b>李强</b></div>
        <div>所属年级：<b>16级</b></div>
        <div>项目名称：<div>
        <b>我的家乡-甘肃</b>
        <div style="width:200px;margin:40px auto;background-color:#cecece">
        姓名:<input type="text" style="width:150px;margin:10px auto" id="name" placeholder="请输入个人姓名" value="">
        密码:<input type="password" style="width:150px;margin:10px auto" id="pass" placeholder="请输入密码" value="">
        <button  style="border:none ;border:1px solid #999;
        background-color:rgb(40, 199, 204)" id="btn">点击登录</button>
        <button  style="border:none ;border:1px solid #999;
        background-color:rgb(40, 199, 204)" id="btn2">去注册</button>
    </div>
</div>
</div>
</body>
<script>
    var btn=document.getElementById("btn")
    getCookie(name)
    getCookie(pass)
    var a= getCookie("name")
    var b= getCookie("pass")
    console.log(a)
    console.log(b)
    btn.onclick=function(){
        var name=document.getElementById("name").value
        var pass=document.getElementById("pass").value
        if(name==a && pass==b){
            alert("登录成功,点击确定后两秒后自动跳转首页")
            setTimeout(function(){
                window.location.href="../html/index.html"
            },2000)
        }else{
            alert("登陆失败,请重新登陆,或者请先注册")
        }
        }
   
        var STR = ""
    $(".hd").load("../html/header.html", function () {
        console.log(1)
        $(".hr").html(STR)
    }, function () {
        $(".hd").html(STR)
        console.log(2)
    })
    btn2.onclick=function(){
        window.location.href="../html/zhuce.html"
    }
    $(".bd").load("../html/footer.html")

</script>
</html>